package com.newegg.nlp.arangodb.dao;

import com.newegg.nlp.arangodb.BasicDao;
import com.newegg.nlp.arangodb.model.Noun;

public interface NounDao extends BasicDao<Noun>{

	default Noun getOrCreate(String noun) {
		Noun n = get(noun.replace(" ", "_"));
		if(n == null) {
			n = new Noun();
			n.setId(noun.replace(" ", "_"));
			n.setName(noun);
			saveNotExist(n);
		}
		return n;
	};
	
}
